package 小红的子串;

import java.util.Scanner;


public class Main {
    static String s;

    static int n, l, r;

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        l = in.nextInt();
        r = in.nextInt();
        s = in.next();
        System.out.println(find(r) - find(l - 1));
    }

    private static long find(int x) {
        int[] has = new int[26];
        int kinds = 0;
        long ret = 0;
        for (int r = 0, l = 0; r < n; r++) {
            if (++has[s.charAt(r) - 'a'] == 1) {
                kinds++;
            }
            while (kinds > x) {
                if (--has[s.charAt(l) - 'a'] == 0) {
                    kinds--;
                }
                l++;
            }
            ret += r - l + 1;
        }
        return ret;
    }
}
